<?php
$sql="SELECT substr( QUYEN,11, 1 ) as mq
FROM qldl_tai_khoan
WHERE ten_dang_nhap = '".$_SESSION['username']."'";
	$query = @mysql_query($sql,$conn);
	$row = @mysql_fetch_array($query);
	if($row['mq']==1){
	 header('Location: index.php?page=q_tri'); 
	}
	else {
			echo  "<script>alert ('Bạn không có quyền truy cập trang này!')</script>"; 
	echo "<meta http-equiv='refresh' content='0;url= index.php'>";
	}
?>
<div class="cpanel-right-tttk">						
<div id="panel-sliders" class="pane-sliders">
<div class="panel">
<table width="100%" border="0" cellspacing="0" cellpadding="0" style=" padding:10px;">
  <thead>
        <tr style=" padding-bottom:10px;">
        <th colspan="2" align="left" style="padding-bottom:10px;">QUẢN LÍ NGƯỜI DÙNG</th>
        </tr> 
        </thead>
  
  <tr valign="top" style="padding:5px;">
   
    <td width="15%" align="center"><a href="index.php?page=id_add_admin">Thêm người dùng mới</a></td>
    <td width="85%"><div style=" padding:0px; border-top: medium none; border-bottom: medium none; overflow: hidden; height: auto; width:100%" align="left">
      <table width="100%" border="1" bordercolor="#666666" class="adminlist_tt">
        <thead>
          <tr>
            <th colspan="4"> Danh sách người dùng</th>
          			<?php
			   		include('quantri_taikhoan/del.php');?>
          </tr>
        </thead>
        <tbody>
        <form action="" method="post" name="form_view" id="form_view">
          <tr>
            <td width="100">Stt</td>
            <td width="290">Tên đăng nhập</td>
            <td width="340">Email</td>
            <td width="187">Cập nhật</td>
          </tr>
           <?php  
	$stt=0;
	$sql="select * from qldl_tai_khoan order by TEN_DANG_NHAP".$_GET['sort'];
	$query = @mysql_query($sql,$conn);	
	if(!$query) echo "Query error to display.";
	else while($row = @mysql_fetch_array($query)){
		$stt++;
		?>
          <tr>
            <td><?php echo $stt;?></td>
                  <td><?php echo $row['TEN_DANG_NHAP'];?></td>
            <td><?php echo $row['EMAIL'];?></td>
            <td valign="middle" align="center">
            <a href="index.php?page=id_edit_admin&amp;id_edit_admin=<?php echo $row['TEN_DANG_NHAP'];?>">Sửa</a>||
                  <a href="#" onclick= "Del_Info('index.php?page=q_tri&amp;id_del_admin=<?php echo $row['TEN_DANG_NHAP'];?>');">Xóa</a>
                  </td>
          </tr>
          <?php } ?>
          </form>
        </tbody>
      </table>
    </div></td>
  </tr>
</table>
</div></div>
					</div>